<?php

namespace frontend\components;

use yii\base\Component;
use common\services\cache\CommonCache;

/**
 * Desc 登录类组件,方便获取登录信息
 * @author HUI
 */
class Shop extends Component {
    
    
    /**
     * 根据token获取店铺信息
     * **/
    public function getShopByToken(){
        $headers = \Yii::$app->getRequest()->getHeaders();
        if(empty($headers->get('token'))){
            return [];
        }
        return CommonCache::getCache($headers->get('token'));
    }
}
